package com.lilosoft.business.cga.service;

import com.lilosoft.business.cga.dao.CgaCaseRelatedPersonMapper;
import com.lilosoft.business.cga.models.CgaCaseRelatedPerson;
import com.lilosoft.business.cga.models.CgaCaseRelatedPersonExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 小峰
 * Date: 2019-08-28
 * Time: 11:38
 */
@Service
public class CgaCaseRelatedPersonService {
    @Autowired
    private CgaCaseRelatedPersonMapper cgaCaseRelatedPersonMapper;

    public CgaCaseRelatedPerson selectByCaseId(String caseId){
        CgaCaseRelatedPersonExample example= new CgaCaseRelatedPersonExample();
        CgaCaseRelatedPersonExample.Criteria criteria = example.createCriteria();
        criteria.andCaseIdEqualTo(caseId);
        List<CgaCaseRelatedPerson> list = cgaCaseRelatedPersonMapper.selectByExample(example);
        if(null!=list && list.size()>0){
            return list.get(0);
        }
        return null;
    }
}
